//
//  FirstInfoViewController.m
//  Mtime
//
//  Created by Mac on 15/8/12.
//  Copyright (c) 2015年 wxk. All rights reserved.
//

#import "FirstInfoViewController.h"
#import "MainViewController.h"

@interface FirstInfoViewController ()
{

    IBOutlet UIScrollView *_scrollView;

    IBOutlet UIButton *enterButton;
    
}
@end

@implementation FirstInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    _scrollView.contentSize = CGSizeMake(kScreenW *4, kScreenH);
    
    //打开分页属性
    _scrollView.pagingEnabled = YES;
    
    _scrollView.delegate = self;
    
    for (int i = 0; i <4; i ++) {
        
        UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(i *kScreenW, 0, kScreenW, kScreenH)];
        
        imageV.image = [UIImage imageNamed:[NSString stringWithFormat:@"wizard%d_480@2x.jpg",i +1]];
        
        [_scrollView addSubview:imageV];
        
    }
    
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

   NSInteger index = scrollView.contentOffset.x/kScreenW;

    if (index == 3) {
        
        enterButton.hidden = NO;
    }else {
    
        enterButton.hidden = YES;
    
    }

}


//进入主程序
- (IBAction)enter:(id)sender {

    [MainViewController loadViewControllers];

}

@end
